#-*- coding: utf8 -*-
from tutor.script import *
from tutor.plugin.maple import *

# variáveis úteis
half = M('1/2')
t = M.t
_i, _j, _k = M('_i, _j, _k')
rr = M('`..`')
coeff = M.coeff

# parâmetros iniciais
k = M(oneof(1, -1)) * oneof(1, 5) / 4 / oneof(1, 2, 3)
c2 = M(oneof(-2, -1, 1, 1, 1, 2, 3))
c4 = M(oneof(-2, -1, 1, 1, 1, 2, 3))

# parametros derivados
c1 = k/3
c5 = c1
c3 = c1 - c2/3
c6 = c4

# campo
F = fieldF = (c1 * x**3 + c2 * x*y**2)*_i + \
             (c3 * y**3 + c4 * M.exp(y) * M.sin(z)) * _j + \
             (c5 * z**3 + c6 * M.exp(y) * M.cos(z)) * _k

# --- resultados --------------------------------------------------------------
print('campo: %s' % F)

# correto 
carga = 124 * Pi * k / 5
print('carga: %s' % carga)

# erros
limite1 = 4 * Pi * k / 5
print('limite1: %s' % limite1)

limite2 = 128 * Pi * k / 5
print('limite2: %s' % limite2)

jacobiano = 14 * Pi**2 * k / 3
print('jacobiano: %s' % jacobiano)

rotacional = 0
print('rotacional: %s' % rotacional)

distrator = 32 * Pi**2 * k / 5
print('distrator: %s' % distrator)


